1. Field of the Invention
The invention relates to an error correction device and method thereof, and more particularly, to an error correction device and method capable of improving the efficiency of the system memory.
2. Description of the Prior Art
In general, when reading data from a DVD disc, the data in the DVD disc are first read by the pickup head of an optical disc drive. Then, the analog signal processor transforms the analog signals generated by the pickup head into digital signals, (e.g., eight-to-fourteen modulation signals). The eight-to-fourteen modulation signals are then processed by an EFM+ demodulator to form row data. Finally, these row data are stored in a memory.
Please refer to FIG. 1, which is a block diagram of a conventional DVD error correction device 100. As shown in FIG. 1, the error correction device 100 comprises a decoding unit 110 and an error correction unit 120. In this case, the error correction unit 120 is coupled to the decoding unit 110, and both the decoding unit 110 and the error correction unit 120 access data in the memory 130 through a bus 140. When the data, which are written into the memory 130, are sufficient to form an error correction code block (ECC block), the decoding unit 110 (e.g., a Reed Solomon Product-like Code (RSPC) decoder) reads the data from the memory 130 through the bus 140 and performs an inner-code parity (PI) decoding operation on the data. Then, the decoding unit 110 passes error addresses and error values to the error correction unit 120 according to the PI decoding results. The error correction unit 120 performs calculation according to the error values and the error addresses, such that the error correction unit 120 can correct some errors of the data stored in the memory 130 through the bus 140.
Subsequently, the decoding unit 110 again reads the data from the memory 130 through the bus 140 and performs an outer-code parity (PO) decoding operation on the data. Then, the decoding unit 110 passes error addresses and error values to the error correction unit 120 according to the PO decoding results. The error correction unit 120 performs calculation according to the error values and the error addresses, such that the error correction unit 120 can again correct some errors of the data stored in the memory 130 through the bus 140. After some repetitions, the data of the DVD, which are stored in the memory 130, can be completely corrected for following use.
Please refer to FIG. 2, which is a diagram of a typical ECC block 200. As shown in FIG. 2, the ECC block 200 is a 182 byte×208 byte block, where in the Pl direction (the horizontal direction) it has 182 bytes and in the PO direction (the vertical direction) it has 208 bytes. Please note that a row in the Pl direction is called a Pl codeword, and a column in the PO direction is called a PO codeword. In addition, the Pl and PO regions represent different correction codes. As mentioned previously, the Pl and PO are utilized by the decoding unit 110 to correct the errors of the DVD data.
However, the memory 130 is often implemented by a dynamic random access memory (DRAM). It is well known that when the DRAM 130 accesses data, if a change row operation needs to be performed, additional memory clocks must be consumed to perform some additionally operations (e.g., row activating and row pre-charging operations). However, when the ECC block 200 is being stored into the memory 130, the data are written in the Pl direction (e.g., as the above-mentioned row data). In order to illustrate more clearly, please refer to FIG. 3, which is a diagram of mapping between the logical structure of the ECC block 200 and the physical addressing of the memory 130. As shown in FIG. 3, the data of the ECC block 200 are row-by-row written into continuous positions of the memory 130. Because one Pl codeword corresponds to 182 bytes, the Pl codeword at most occupies two rows of the DRAM 130, due to its 1024-byte row width. Therefore, when the Pl decoding operation is performed to execute the data correction operation, it is not necessary that the above-mentioned change row operation be performed for so many iterations. But, when the PO decoding operation is performed to execute the data correction operation, because data of a PO codeword is bound to distribute among multiple rows of the DRAM 130, the change row operation is performed many times. Obviously, frequent change row operations occupy many memory clock periods and result in poor efficiency of the memory 130.